{extend name='admin@main'}

{block name="button"}

{if auth("get_user")}
<a class="layui-btn layui-btn-sm layui-btn-normal" data-confirm="确定要同步员工列表信息吗？" data-value="id#{key}" data-action="{:url('get_user')}">同步员工列表信息</a>
{/if}

{/block}

{block name="content"}
<style>
    .layui-badge{
        margin: 1px;
    }
</style>
<div class="think-box-shadow">
    {include file='ding_user/index_search'}
    <table class="layui-table" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='text-center nowrap'>userid</th>
            <th class='text-center nowrap'>unionid</th>
            <th class='text-center nowrap'>员工名称</th>
            <th class='text-center nowrap'>头像</th>
            <th class='text-center nowrap'>直属主管</th>
            <th class='text-left nowrap'>手机号码</th>
            <th class='text-center nowrap'>职位</th>
            <!-- <th class='text-left nowrap'>员工邮箱</th> -->
            <!-- <th class='text-left nowrap'>员工的企业邮箱</th> -->
            <th class='text-left nowrap'>所属部门</th>
            <!-- <th class='text-center nowrap'>入职时间</th> -->
            <th class='text-center nowrap'>是否激活了钉钉</th>
            <!-- <th class='text-left nowrap'>是否为企业的高管</th> -->
            <th class='text-center nowrap'>是否为企业的管理员</th>
            <!-- <th class='text-left nowrap'>是否为企业的老板</th> -->
            <th class='text-left nowrap'>角色列表</th>
            <th class='text-left nowrap'></th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr data-dbclick>
            <td class='text-center nowrap'>{$vo.userid|default=''}</td>
            <td class='text-center nowrap'>{$vo.unionid|default=''}</td>
            <td class='text-center nowrap'>{$vo.name|default=''}</td>
            <td class='text-center nowrap'>
                <img data-tips-image="{$vo.avatar|default=''}" src="{$vo.avatar|default=''}" alt="" width="40px">
            </td>
            <td class='text-center nowrap'>
                <span class="color-blue">{$vo.manager_name|default=''}</span>
            </td>
            <td class='text-left nowrap'>{$vo.mobile|default=''}</td>
            <td class='text-center nowrap'>{$vo.title|default=''}</td>
            <!-- <td class='text-left nowrap'>{$vo.email|default=''}</td>
            <td class='text-left nowrap'>{$vo.org_email|default=''}</td> -->
            <td class='text-left nowrap'>
                {foreach $vo.department_name_list as $v}
                <span class="layui-badge layui-bg-green">{$v}</span>
                {/foreach}
            </td>
            <!-- <td class='text-center nowrap'>{$vo.hired_date|default=''}</td> -->
            <td class='text-center nowrap'>
                {if $vo.active == 1}
                <span class="color-green">是</span>
                {else}
                <span class="color-red">否</span>
                {/if}
            </td>
            <!-- <td class='text-left nowrap'>{$vo.senior|default=''}</td> -->
            <td class='text-center nowrap'>
                {if $vo.admin == 1}
                <span class="color-green">是</span>
                {else}
                <span class="color-red">否</span>
                {/if}
            </td>
            <!-- <td class='text-left nowrap'>{$vo.boss|default=''}</td> -->
            <td class='text-left nowrap'>
                {foreach $vo.role_list as $v}
                <span class="layui-badge layui-bg-orange">{$v.name} </span>
                {/foreach}
            </td>
            <td class='text-left nowrap'>
                {if auth("edit")}
                <a class="layui-btn layui-btn-sm" data-title="考勤记录" data-open='{:url("ding_attendance/index")}?userid={$vo.userid}'>近7天考勤记录</a>
                {/if}
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>

    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

</div>

{/block}
